
package std.crypto.digest
import std.io.{InputStream, OutputStream}


@!APILevel[
    since: "22"
]
public interface Digest {
    @!APILevel[
        since: "22"
    ]
    prop size: Int64
    
    @!APILevel[
        since: "22"
    ]
    prop blockSize: Int64
    
    @!APILevel[
        since: "22"
    ]
    prop algorithm: String
    
    @!APILevel[
        since: "22"
    ]
    func write(buffer: Array<Byte>): Unit
    
    @!APILevel[
        since: "22"
    ]
    func finish(to!: Array<Byte>): Unit
    
    @!APILevel[
        since: "22"
    ]
    func finish(): Array<Byte>
    
    @!APILevel[
        since: "22"
    ]
    func reset(): Unit
}

@Deprecated[message: "Use global function `public func digest<T>(algorithm: T, input: InputStream): Array<Byte> where T <: Digest` instead."]
@!APILevel[
    since: "22"
]
public func digest<T>(algorithm: T, data: String): Array<Byte> where T <: Digest

/**
* @throws IndexOutOfBoundsException
* @throws IllegalArgumentException
*/
@!APILevel[
    since: "22",
    throwexception: true
]
public func digest<T>(algorithm: T, input: InputStream): Array<Byte> where T <: Digest

@!APILevel[
    since: "22"
]
public func digest<T>(algorithm: T, data: Array<Byte>): Array<Byte> where T <: Digest

